#from django.template.loader import get_template
#from django.template import Context
from django.http import HttpResponse
from django.shortcuts import render_to_response
import datetime

def current_datetime(request):
    now = datetime.datetime.now()
#    t = get_template('current_datetime.html')
#    html = t.render(Context({'current_date': now}))
#    return HttpResponse(html)
    
    return render_to_response('current_datetime.html', {'current_date': now})

def request_item(request):
    item_list = request.META.items()
    item_list.sort()
    return render_to_response('request_item.html', {'item_list': item_list})

def hours_ahead(request, offset):
    offset = int(offset)
    dt = datetime.datetime.now() + datetime.timedelta(hours=offset)
    return render_to_response('hours_ahead .html', {'current_date': dt})
